//
//  KVObj.m
//  Etion
//
//  Created by wu jingxing on 12-7-18.
//  Copyright (c) 2012年 GuangZhouXuanWu. All rights reserved.
//

#import "XMSKvPair.h"

@implementation XMSKvPair

@synthesize idKey = _key;
@synthesize idValue = _value;

+(XMSKvPair*)kvPairWithKey:(id)key value:(id)value
{
    XMSKvPair *kv = [[XMSKvPair new] autorelease_mm];
    kv.idKey = key;
    kv.idValue = value;
    return kv;
}

- (id)copyWithZone:(NSZone *)zone
{
    XMSKvPair *pair = [[self class] allocWithZone:zone];

    pair.idKey = _key;
    pair.idValue = _value;

    return pair;
}

- (NSString *)descriptionWithSpace:(NSString *)space
{
    return [NSString stringWithFormat:@"\n%@{\n%@    key = %@\n%@    value = %@\n%@}", space, space, [_key descriptionWithSpace:[space stringByAppendingString:@"    "]], space, [_value descriptionWithSpace:[space stringByAppendingString:@"    "]], space];
}

- (NSString *)description
{
    return [self descriptionWithSpace:@""];
}

- (void)dealloc
{
    [_key release_mm];
    [_value release_mm];
    superdealloc_mm;

}
@end